<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:h="http://xmlns.jcp.org/jsf/html">
    <h:head>
        
    </h:head>
    <h:body>
        <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                        template="templates/admin.xhtml">
            <ui:define name="content">
                <h:form>
                    #{loginBean.checkLogin()}
                    <div class="signin-card">
                        <img class="profile-img" 
                             src="./resources/images/avatar_2x.png" alt=""
                             width="100px"
                             style="margin: auto;text-align: center"/>
                        <p class="profile-name"></p>
                        <h:form>
                            <table cellpadding="5px;">
                                <tr>
                                    <td>
                                        <h:inputText id="username" 
                                                     value="#{loginBean.account.username}"
                                                     class="login-control"
                                                     pt:placeholder="Username"
                                                     required="true"
                                                     requiredMessage="Enter your username."/>
                                        <br/>
                                        <h:message for="username" showDetail="true" showSummary="false"
                                                   errorClass="error_messages" />

                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <h:inputSecret id="password" 
                                                       value="#{loginBean.account.password}"
                                                       class="login-control"
                                                       pt:placeholder="Password"
                                                       required="true"
                                                       requiredMessage="Enter your password."/>
                                        <br/>
                                        <h:message for="password" showDetail="true" showSummary="false"
                                                   errorClass="error_messages"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <h:message for="" id="msg" 
                                                   showDetail="true" 
                                                   showSummary="false"
                                                   errorClass="error_messages"
                                                   />
                                        <h:commandButton 
                                            styleClass="loginButton"
                                            action="#{loginBean.login()}"
                                            value="Login"/> 
                                    </td>
                                </tr>
                                <tr>
                                    <td><a href="#" style="line-height: 40px;">Can't access your account?</a></td>
                                </tr>
                            </table>
                        </h:form>
                        
                        <br/>
                    </div>
                </h:form>
            </ui:define>
        </ui:composition>

    </h:body>
</html>
